package array

func searchInsert(nums []int, target int) int {
	n := len(nums)
	low := 0
	hight := n - 1
	ans := n
	for low <= hight {
		mid := (hight-low)>>1 + low
		if target <= nums[mid] {
			ans = mid
			hight = mid - 1
		} else {
			low = mid + 1
		}
	}
	return ans
}
